#include "Text.h"
#include "../debug_new.h"


CText::~CText(void)
{
}

CText::CText(UINT nID):CControl(nID)
{
	m_dwTxtAlign =  DT_LEFT |DT_WORDBREAK;
	InitColor();
}

CText::CText(wstring strCaption,UINT nID):
CControl(strCaption,nID)
{
	m_dwTxtAlign = DT_LEFT |DT_WORDBREAK;

	InitColor();
}

CText::CText(DWORD dwStyle,wstring strCaption, const CRect &rc, UINT nID)
:	CControl(dwStyle,strCaption, rc, nID)
{
	m_dwTxtAlign =  DT_LEFT |DT_WORDBREAK;

	InitColor();
}

CText::CText(DWORD dwStyle, wstring strCaption, int x, int y, int cx, int cy, UINT nID)
:	CControl(dwStyle, strCaption, x, y, cx, cy, nID)
{
	m_dwTxtAlign =  DT_LEFT |DT_WORDBREAK ;

	InitColor();
}


void CText::InitColor()
{

}

void CText::Paint(CDC* pDC)
{
	
	
	if(m_rcControl.IsRectEmpty())
	{
		return ;
	}

	if(!IsVisible())
	{
		return;
	}

	BEGIN_FONT_SELECTION
	
	COLORREF rgbOldT = pDC->SetTextColor(m_clrTxtNormal);
	pDC->SetBkMode(TRANSPARENT);

	pDC->DrawText(m_strCaption.c_str(), m_strCaption.size(),&m_rcControl, m_dwTxtAlign);
	
	pDC->SetTextColor(rgbOldT);

	END_FONT_SELECTION
}


//wince 
//#define DT_TOP              0x00000000
//#define DT_LEFT             0x00000000
//#define DT_CENTER           0x00000001
//#define DT_RIGHT            0x00000002
//#define DT_VCENTER          0x00000004
//#define DT_BOTTOM           0x00000008
//#define DT_WORDBREAK        0x00000010
//#define DT_SINGLELINE       0x00000020
//#define DT_EXPANDTABS       0x00000040
//#define DT_TABSTOP          0x00000080
//#define DT_NOCLIP           0x00000100
//#define DT_EXTERNALLEADING  0x00000200
//#define DT_CALCRECT         0x00000400
//#define DT_NOPREFIX         0x00000800
//#define DT_INTERNAL         0x00001000
//#define DT_EDITCONTROL      0x00002000
//#define DT_END_ELLIPSIS     0x00008000
//#define DT_RTLREADING       0x00020000
//#define DT_WORD_ELLIPSIS    0x00040000


